home *** CD-ROM | disk | FTP | other *** search
/ Gekikoh Dennoh Club 1 / Gekikoh Dennoh Club Vol. 1 (Japan).7z / Gekikoh Dennoh Club Vol. 1 (Japan) (Track 1).bin / kowin / archive / apl / gview120.lzh / gviewsrc.lzh / ugopen.c < prev    next >
C/C++ Source or Header  |  1995-02-27  |  683b  |  31 lines

  1. /*    Copyright 1992 H.Ogasawara (COR.)    */
  2.  
  3. #include    <corlib.h>
  4. #include    <sys_doslib.h>
  5. #include    "gview.h"
  6.  
  7. GVIEW *
  8. GV_UG_Open( ug )
  9. UGraphic *ug;
  10. {
  11.     GVIEW    *gp;
  12.     int    x, y;
  13.     WindowGetGraphicOffset( &x, &y );
  14.     if( !(gp= GV_Alloc( ug->h, ug->v, ug->color, "", NULL, 0 )) ){
  15.         GV_Err( "メモリが足りません" );
  16.         return    NULL;
  17.     }
  18.     if( ug->color != WindowAttrGraphic65536 ){
  19.         int    size= GV_PaletSize( ug->color );
  20.         if( ug->palet ){
  21.             memcpy( gp->palet, ug->palet, size*2 );
  22.         }else
  23.             GV_GetSysPalet( gp );
  24.         GV_PaletToBase( gp );
  25.         memcpy( gp->buf, ug->buf, ug->h*ug->v );
  26.     }else
  27.         memcpy( gp->buf, ug->buf, ug->h*ug->v*2 );
  28.     GV_Open( x, y, gp );
  29.     return    gp;
  30. }
  31.